#!/bin/bash

#! amount args
# ${_is_amount_arg} ${NARGS} min_equ max_equ
# if [ $? -ne 0 ]; then
#     plt_pause "${_is_amount_arg}:: be return 1 <- Fail: ${FNLOCK}"
#     return 1
# fi
#! normalize ptr_path -> absolut path
# ptr_path=$1
# ptr_path=$(${_abs_path} $PPWD "ptr_path") #ptr args
#! variables for cr_f_dir_insert_
# fn_name=$(${_prs_f} -n ${arg_path})
# root_path=$(${_prs_f} -d ${arg_path})
#! search in array
# [[ " ${arr[*]} " =~ " $1 " ]] && echo "true" || echo "false"
#! ${array[@]:1} all from 1 member arr

echo -e "${GREEN}\${g_args[@]} = ${g_args[*]}${NORMAL}" #print variable
echo -e "${GREEN}\${e_args[@]} = ${e_args[*]}${NORMAL}" #print variable
echo -e "${GREEN}\${f_args[@]} = ${f_args[*]}${NORMAL}" #print variable
echo -e "${GREEN}\${ARGS[@]} = ${ARGS[*]}${NORMAL}"     #print variable
echo -e "${GREEN}\${ARGS0} = ${ARGS0}${NORMAL}"         #print variable
echo -e "${GREEN}\${ARGS1} = ${ARGS1}${NORMAL}"         #print variable
echo -e "${GREEN}\${ARGS2} = ${ARGS2}${NORMAL}"         #print variable

echo -e "${GREEN}\${dir_fns_} = ${dir_fns_}${NORMAL}" #print variable

echo -e "${GREEN}\${local_var_wrap_arr[@]} = ${local_var_wrap_arr[*]}${NORMAL}" #print variable
echo -e "${GREEN}\${local_var_fn_arr[@]} = ${local_var_fn_arr[*]}${NORMAL}"     #print variable

echo -e "${GREEN}\$ratis = $ratis${NORMAL}" #print variable

echo "that ${FNN}.sal"

#! list_strong_cntls=(?str_ ?del_ ?parr_)

# for item in "${list_strong_cntls[@]}"; do
#     echo -e "${GREEN}\$item = $item${NORMAL}" #print variable
#     echo "$(eval echo \$"$item")"
#     if [ -z "$(eval echo \$"$item")" ]; then
#         plt_info "$item is empty"
#         return 1
#     fi
# done

#?--------------------------------------------------------
#?---------------------------------------------
#?---------------------------------------

filename="${ARGS0}"

filename=$("${_abs_path}" "$PPWD" "filename") #ptr args

plt_pause "create $filename from tml :: ${PATH_TML_DIR}/cr_shf_/shf.tml , ins :: ${PLT_PATH}/.d/.insert/cr_shf_ ?"

# copy tml
cr_f_ \
    "$filename" \
    --tml "${PATH_TML_DIR}/cr_shf_/shf.tml"

header=${PATH_INSERT_DIR}/cr_shf_/header.insert

name_fntmp="fntmp_$("${_rand3e}" 10)"
echo -e "${GREEN}\$name_fntmp = $name_fntmp${NORMAL}" #print variable

cr_f_ \
    "$filename" \
    --fi0 "${header}" --fr0 "{header}" \
    --vi0 "$filename" --vr0 "{filename}" \
    --vi1 "$name_fntmp" --vr1 "{name_fntmp}"

"${_obs_quis_}" "$filename"

#?---------------------------------------
#?---------------------------------------------
#?--------------------------------------------------------
